import { CHANGECONTENTPAGEACTIVATE } from "../constants";

const  initState = {
    contentpage: {
        content_data: [],
        total: 0,
        page: 1
    },
    // {
    //     avatar: "", // 头像
    //     content: "", // 任务介绍
    //     description: "", // 任务类型
    //     nickname: "", // 昵称
    //     title: "", // 任务标题
    //     userintro: "" // 雇主介绍
    // }
}

export default function ContentpageReducer (preState = initState, action){
    const { type, data } = action
    switch (type) {
        case CHANGECONTENTPAGEACTIVATE:
            return {
                ...preState,
                contentpage: Object.assign({}, preState.contentpage, data)
            }
        default:
            var state = preState
            return state
    }
}